<?php

$link = mysqli_connect('localhost', 'root', '') or die("Failed to connect to MySQL: " . mysql_error());
if (mysqli_connect_errno()) {
        echo 'Failed to connect to MySQL';
        exit;
}
$sql = "USE web_db";
$resultado = mysqli_query($link,$sql);

	function get_news($rank,$link){
		$sql = "SELECT * FROM news
				WHERE workstation = '$rank' OR workstation=0";
		$resultado = mysqli_query($link,$sql);
		
		return $resultado;
	}
?>